import axiosApi from "../AxiosApi";
// 创建流程分类
const apiList = {
  processStructure: {
    method: 'get',
    url: `/api/v1/work-order/process-structure`
  },
  createWorkOrder: {
    method: 'post',
    url: `/api/v1/work-order/create`
  },
  workOrderList: {
    method: 'post',
    url: `/api/v1/work-order/list`
  },
  handleWorkOrder: {
    method: 'post',
    url: `/api/v1/work-order/handle`
  },
  unityWorkOrder: {
    method: 'get',
    url: `/api/v1/work-order/unity`
  },
  inversionWorkOrder: {
    method: 'post',
    url: `/api/v1/work-order/inversion`
  },
  urgeWorkOrder: {
    method: 'get',
    url: `/api/v1/work-order/urge`
  },
  activeOrder: {
    method: 'put',
    url: `/api/v1/work-order/active-order/`
  },
  deleteWorkOrder: {
    method: 'delete',
    url: `/api/v1/work-order/delete/`
  },
  reopenWorkOrder: {
    method: 'get',
    url: `/api/v1/work-order/reopen/`
  },
}
export default {
  // 流程结构
  processStructure (data) {
    return axiosApi({
      ...apiList.processStructure,
      data
    })
  },
// 新建工单
  createWorkOrder (data) {
    return axiosApi({
      ...apiList.createWorkOrder,
      data
    })
  },
// 工单列表
  workOrderList (data) {
    return axiosApi({
      ...apiList.workOrderList,
      data
    })
  },
// 处理工单
  handleWorkOrder (data) {
    return axiosApi({
      ...apiList.handleWorkOrder,
      data
    })
  },
// 结束工单
  unityWorkOrder (data) {
    return axiosApi({
      ...apiList.unityWorkOrder,
      data
    })
  },
// 转交工单
  inversionWorkOrder (data) {
    return axiosApi({
      ...apiList.inversionWorkOrder,
      data
    })
  },
// 催办工单
  urgeWorkOrder (data) {
    return axiosApi({
      ...apiList.urgeWorkOrder,
      data
    })
  },
// 主动接单
  activeOrder (id) {
    return axiosApi({
      url: apiList.activeOrder.url+`${id}`,
      method: apiList.activeOrder.method
    })
  },
// 删除工单
  deleteWorkOrder (id) {
    return axiosApi({
      url: apiList.deleteWorkOrder.url+`${id}`,
      method: apiList.deleteWorkOrder.method
    })
  },
  reopenWorkOrder (id) {
    return axiosApi({
      url: apiList.reopenWorkOrder.url+`${id}`,
      method: apiList.reopenWorkOrder.method
    })
  },
}



